package ro.theneckmaster.usbSync;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;

import ro.theneckmaster.usbSync.gui.MainFrame;


public class Main {

	public static void createAndShowGUI() {

		JFrame.setDefaultLookAndFeelDecorated(true);
		MainFrame frame = new MainFrame();
		centerWindowAndShow(frame);
		
	}

	public static void centerWindowAndShow(JFrame frame) {

		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

		int y = (int) (screenSize.height / 2 - frame.getHeight() / 2);
		int x = (int) (screenSize.width / 2 - frame.getWidth() / 2);
		frame.setLocation(x, y);

		frame.setVisible(true);

	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		javax.swing.SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				createAndShowGUI();
			}
		});

	}

}
